package com.xj.mq.mqserver.mapper;

import com.xj.mq.mqserver.core.Binding;
import com.xj.mq.mqserver.core.Exchange;
import com.xj.mq.mqserver.core.MessageQueue;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 * Description
 * User: 王杰
 * Date: 2025-05-14
 * Time: 19:58
 */

@Mapper
public interface MetaMapper {
    // 提供三个核心建表方法
    void createExchangeTable();
    void createQueueTable();
    void createBindingTable();

    // 针对上述三个基本概念 进行插入和删除
    void insertExchange(Exchange exchange);
    List<Exchange> selectAllExchanges();
    void deleteExchange(String exchangeName);
    void insertQueue(MessageQueue messageQueue);
    List<MessageQueue> selectAllQueues();
    void deleteQueue(String queueName);
    void insertBinding(Binding binding);
    List<Binding> selectAllBindings();
    void deleteBinding(Binding binding);
}
